package org.activiti.solon.constants;

import lombok.Getter;

/**
 * 审核标记状态
 */
@Getter
public enum AuditFlagEnum {
    REJECT(0, "已驳回", "已驳回，未提交"),
    SUBMIT(1, "待提交", "已保存，未提交"),
    AUDIT(2, "待审核", "已提交，流程处理中，需要审核"),
    DEPLOY(3, "待发布", "审核通过，需要发布"),
    FINISH(4, "已完成", "发布完成，版本号+1");

    private final int val;
    private final String name;
    private final String desc;

    AuditFlagEnum(int val, String name, String desc) {
        this.val = val;
        this.name = name;
        this.desc = desc;
    }

    public static String getNameByVal(int val) {
        for(AuditFlagEnum e : AuditFlagEnum.values()) {
            if (e.getVal() == val) {
                return e.getName();
            }
        }
        return null;
    }
}
